<div class="classic-popup" id="formLogin">
	<div class="classic-popup-top">
		<div class="right">
			<div class="bg">
			</div>
		</div>
	</div>
	<div class="classic-popup-main">
		<div class="classic-popup-title">
			<div class="fl">
				<?= lang('login') ?></div>
			<div class="c">
			</div>
		</div>
		<div class="classic-popup-content">
			<form id="customer_login_form" method="post">
				<div style="padding:1px 0 0" class="content login_form">
					<div class="cError">
						<div style="display:none;width: 300px; color:red; margin: 5px auto 15px; padding:10px; background:rgb(255, 249, 215); border: 1px solid rgb(226, 200, 34); text-align: center; font-size: 15px;" class="my_msg">							
						</div>
					</div>
					<div class="mTop10">
						<table cellspacing="5" cellpadding="0">
							<tbody>
								<tr class="reg_collapse">
									<td width="140" align="right">
										<b><?= lang('username') ?>:</b>
									</td>
									<td width="200">
										<input type="text" name="username">
									</td>
								</tr>
								<tr class="mTop10 reg_collapse">
									<td align="right">
										<b><?= lang('password') ?>:</b>
									</td>
									<td>
										<input type="password" name="password">
									</td>
								</tr>
								<tr>
									<td>
									</td>
									<td align="left">
										<div class="mTop10">
											<input type="checkbox" class="m0" id="remember">
											<span style="color:#006997" class="login_oke f11 pLeft5">
												<?= lang('remember') ?>
											</span>
										</div>
									</td>
								</tr>
							</tbody>
						</table>
					</div>
					<div class="mTop10">
						<div style="width:230px;margin:0 auto">
							<a href="javascript:void(0)" class="closeButtonLogin mLeft15">
								<?= lang('forget_password') ?>?
							</a>
							<a id="loginSubmit" href="javascript:void(0)" class="blueButton">
								<span>
									<span>
										<?= lang('login') ?>
									</span>
								</span>
							</a>
							<input type="submit" class="hidden" value="">
							<div class="c">
							</div>
						</div>
					</div>
					<div align="center" style="padding:15px 0;background:#fefbc4;border-top:1px solid #d5d0cd" class="mTop15">
						<div class="f14">
							<b style="color:#006aa6">
								<?= lang('dont_have_account') ?>?
							</b>
						</div>
						<table class="mTop10">
							<tbody>
								<tr>
									<td>
										<a href="javascript:void(0)" onclick="open_popup('formRegister')"class="orangeButtonRegis">
											<span>
											</span>
										</a>
									</td>
								</tr>
							</tbody>
						</table>
						<div class="c">
						</div>
					</div>
				</div>
			</form>
			<script>
				$('#loginSubmit').click(function(){
					$('#customer_login_form').submit();
				})
				$('#customer_login_form').submit(function(){
					var t= $(this)
					$.ajax({
						url: '<?= url_create('site', 'account', 'login') ?>',
						data: t.serialize(),
						type: 'post',
						dataType: 'json',
						success: function(o)
						{
							if(o.state=='success'){
								window.location = window.location.href;
							}
							else{
								var str='';
								for(var i in o.errors){
									if(o.errors[i]!=''){
										str+=o.errors[i];
										t.find('[name="'+i+'"]').addClass('error');
									}
								}
								t.find('.cError div').html(str);
								t.find('.cError div').css({display: 'block'})
								$.colorbox.resize();
							}
						}
					});
					return false;
				})
			</script>
		</div>
	</div>
	<div class="classic-popup-bottom">
		<div class="right">
			<div class="bg">
			</div>
		</div>
	</div>
</div>
